package com.dtp.core;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @author evolution
 * @title: DtpBeanPostProcessor
 * @projectName dtp-nacos
 * @description: TODO
 * @date 2022-10-20 15:04
 */

public class DtpBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        if (bean instanceof DtpExecutor) {
            DtpUtil.set(beanName, (DtpExecutor) bean);
        }
        return bean;
    }
}
